<include file="Core:Public:header" />
<link rel="stylesheet" href="__PUBLIC__/css/treeview/jquery.treeview.css" type="text/css">
<link rel="stylesheet" href="__PUBLIC__/css/table.css" type="text/css">


<script type="text/javascript" src="__PUBLIC__/js/treeview/jquery.treeview.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/treeview/jquery.treeview.edit.js"></script>
<script src="__PUBLIC__/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript">
	$(function() {
		$("#browser").treeview();
	})
	
</script>
<style type="text/css">
.ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position:-144px 0; vertical-align:top; *vertical-align:middle}

.tsubmit{
width:70px;height:30px;background-color:#0789cc;border:hidden;
-moz-box-shadow: 2px 2px 1px #909090;
-webkit-box-shadow: 2px 2px 1px #909090;
box-shadow:2px 2px 1px #909090;
border-radius:10px;
font-family:黑体;
font-size:15px;
color:white;
text-align:center;
}
.tsubmit:hover{
	background-color:#055680;
}

.table_list{
	width:100%;
	background-color:#efdede;
	border:1px solid #CC9999;
}
.table_list tr{
	width:100%;
	background-color:#d8b9b9;
	line-height:40px;
	font-size:12px;
}
.table_list tr:first-child {
	color:#2b1c1c;
	font-family:黑体;
	font-size:15px;
	font-weight:bold;background:#ffffff;border-bottom:1px solid #CC9999;}
.table_list tr:nth-child(2n){background:#f3e8e8;}

.theader{
	width:100%;
	height:40px;
}
.theader ul{
	list-style:none;
	
}
.theader ul li{
	float:left;
	text-align:center;
	line-height:40px;
	width:150px;
	
}
.theader ul a{
	text-decoration:none;
	color:#ffffff;
	font-size:20px;
	font-family:黑体;
	text-shadow:1px 1px 1px dimgray;
	}

.tli{
	background-color:#f3e8e8;
	border-top:1px solid #944949;
	border-left:1px solid #944949;
	border-right:1px solid #944949;
}	
.tcurrent{
	background-color:#CC9999;	
}	
.table_list2{
	width:100%;
	background-color:#8B668B;
	border:1px solid #9b599b;
}
.table_list2 tr{
	width:100%;
	background-color:#d9aed9;
	line-height:40px;
	font-size:12px;
}
table tr td{
	padding-left:5px;
}
.table_list2 tr:first-child {
	color:#2b1c1c;
	font-family:黑体;
	font-size:15px;
	font-weight:bold;background:#ffffff;border-bottom:1px solid #653265;}
.table_list2 tr:nth-child(2n){background:#f3e8e8;}

.ebutton{
	width:70px;
	height:25px;
	background-color:#ca7d7d;
	line-height:23px;
	border-radius:6px;
	border:1px solid #964f4f;
	color:#ffffff;
	text-align:center;
}
.ibutton{
	width:70px;
	height:25px;
	background-color:#8c538c;
	line-height:23px;
	border-radius:6px;
	border:1px solid #964f4f;
	color:#ffffff;
	text-align:center;
}
.ibutton:hover{
	background-color:#ecbcec;
}
.look a{
	text-decoration:none;
}
.right_main{
	width:100%;
	height:750px;
	background-color:#f8f9fd;
	border:1px solid #e9edf9;
}
.modal-open .modal {
    overflow-x: hidden;
    overflow-y: auto;
}

.modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    display: none;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    outline: 0;
}
.fade {
    opacity: 0;
    -webkit-transition: opacity .15s linear;
    -o-transition: opacity .15s linear;
    transition: opacity .15s linear;
}
.modal-dialog {
    width: 600px;
    margin: 30px auto;
}

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}


</style>
{:W('Navigation')}

<div class="body-right">
	<div class="row-table">
		<div class="row-table-title">营业额列表</div>
	</div>
	<div class="right_main">
		<div class="theader">
			
			<ul>
				<a href="{:U('chrm/turnover/table_list','st=turnover')}" onmouseover="setblock(2)">
					<if condition="$path eq 'turnover'">
						<li class="tli tcurrent">营业额</li>
					<else/>
						<li class="tli">营业额</li>
					</if>
				</a>
				<a href="{:U('chrm/turnover/table_list','st=expend')}" onmouseover="setblock(1)">
					<if condition="$path eq 'expend'">
						<li class="tli tcurrent">支出</li>
					<else/>
						<li class="tli">支出</li>
					</if>
					
				</a>
				<a href="{:U('chrm/turnover/table_list','st=income')}" onmouseover="setblock(2)">
					<if condition="$path eq 'income'">
						<li class="tli tcurrent">收入</li>
					<else/>
						<li class="tli">收入</li>
					</if>
				</a>
				<li style="margin-left:50px;height:30px;width:300px;">
					
					<form action="{:U('chrm/turnover/search_list')}" method="post">
				    	选择日期:
				    	<input type="text" name="tdate" class="form-control" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="{$tdate|date="Y-m-d",###}" style="width:120px;"/>
				    	<input type="hidden" name="action" value="{$path}" />
				    	<input type="hidden" name="form" value="day" />
				    	<input type="submit" value="查询"  class="btn btn-primary" />
					</form>
				</li>
				<li style="margin-left:10px;height:30px;width:300px;">
					<form action="{:U('chrm/turnover/search_list')}" method="post">
				    	选择月份:
				    	<input type="text" name="tdate" class="form-control" onclick="WdatePicker({dateFmt:'yyyy-MM'})" value="{$tdate|date="Y-m",###}" style="width:120px;"/>	
				    	<input type="hidden" name="action" value="{$path}" />
				    	<input type="hidden" name="form" value="month" />
				    	<input type="submit" value="查询"  class="btn btn-primary" />
					</form>
				</li>
				<li style="float:right;">
					<button class="btn btn-primary" data-toggle="modal" data-target="#myModal">导出</button>
				</li>
			</ul>
		</div>
	<div id="tab1" >
	<table class="table_list">
			<tr>
				<td>支出日期</td>
				<td>总金额</td>
				<td>团队</td>
				<td>备注</td>
				<td>添加时间</td>
				<td>操作</td>
			</tr>
		<volist name="list" id="v">
			<tr>
				<td>{$v.total_date|date="Y-m-d H:i",###}</td>
				<td>{$v.money_sum}</td>
				<td>{$v.depname}</td>
				<td>{$v.desc}</td>
				<td>{$v.add_time|date="Y-m-d H:i",###}</td>
				<td class="look">
					<a href="{:U('chrm/turnover/expend','total_id='.$v['total_id'])}" style="float:left;"><div class="ebutton">查看详细</div></a>
				<if condition="$path eq 'income'">
					<a href="{:U('chrm/turnover/expend_update','total_id='.$v['total_id'])}"style="float:left;margin-left:20px;" ><div class="ebutton">修改</div></a>
				<elseif condition="$path eq 'expend'"/>
					<a href="{:U('chrm/turnover/expend_update','total_id='.$v['total_id'])}"style="float:left;margin-left:20px;" ><div class="ebutton">修改</div></a>
				<elseif condition="$path eq 'turnover'"/>
					<a href="{:U('chrm/turnover/turnover_update','total_id='.$v['total_id'])}"style="float:left;margin-left:20px;" ><div class="ebutton">修改</div></a>
				</if>
					<a href="{:U('chrm/turnover/total_delete','total_id='.$v['total_id'])}" onClick="return firm({$v.total_id})" style="float:left;margin-left:20px;" ><div class="ebutton">删除</div></a>
				</td>
			</tr>
		</volist>
			
	</table>

	</div>
</div>
	
</div>
<div class="clear"></div>


<script type="text/javascript">
function g(o){return document.getElementById(o);}
function setblock(n){
	g('tab'+n).className='tabs';
}

    function firm(id)
    {
        if(confirm("你确定要删除吗？"))
        {
           return true;
        }
        else
        {
            return false; 
        }
    }
    errorstr("{$str}");
    function errorstr(str){
    	if(str != 0){
    		alert(str);
    	}
    	
    }
</script>

<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
        <form method="post" action="{:U('chrm/turnover/total_export')}">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">导出营业额</h4>
            </div>
            <div class="modal-body">
           		<ul style="list-style:none;line-height:40px;">
            	<li>导出类型：<select id="doc-select-1" name="type">
										<option value="to" selected>营业额</option>
										<option value="expend">支出</option>
								</select>
				</li>
            	<li>导出日期：
									<input type="text" name="tdate" class="form-control" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="" style="width:120px;"/>	
							
				</li>
				<li>
					日期类型：
						<input type="radio" name="radio" value="1" checked>日</input>
						<input type="radio" name="radio" value="2">月</input>
						<input type="radio" name="radio" value="3">年</input>
				</li>
				</ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="submit" class="btn btn-primary">确认导出</button>
            </div>
           </form> 
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>



<include file="Core:Public:alert" />
<include file="Core:Public:footer" />